/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.tgroupinfo.service;

import java.util.List;

import com.jeeplus.common.json.AjaxJson;
import com.jeeplus.mob.common.DataConvertHelper;
import com.jeeplus.mob.common.StringHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.tgroupinfo.entity.TGroupInfo;
import com.jeeplus.modules.tgroupinfo.mapper.TGroupInfoMapper;

/**
 * 小组管理Service
 * @author pr
 * @version 2022-04-18
 */
@Service
@Transactional(readOnly = true)
public class TGroupInfoService extends CrudService<TGroupInfoMapper, TGroupInfo> {

	@Autowired
	private TGroupInfoMapper tGroupInfoMapper;

	public AjaxJson getGroupInfoByDepId(String id){
		List<TGroupInfo> groupInfoByDepId = tGroupInfoMapper.getGroupInfoByDepId(id);
		if (groupInfoByDepId.size() > 0 && !StringHelper.IsEmptyOrNull(groupInfoByDepId)) {
			return AjaxJson.success().put("result",groupInfoByDepId);
		}
		return AjaxJson.success("无数据结果，请重试");
	}

	public TGroupInfo get(String id) {
		return super.get(id);
	}
	
	public List<TGroupInfo> findList(TGroupInfo tGroupInfo) {
		return super.findList(tGroupInfo);
	}
	
	public Page<TGroupInfo> findPage(Page<TGroupInfo> page, TGroupInfo tGroupInfo) {
		return super.findPage(page, tGroupInfo);
	}
	
	@Transactional(readOnly = false)
	public void save(TGroupInfo tGroupInfo) {
		super.save(tGroupInfo);
	}
	
	@Transactional(readOnly = false)
	public void delete(TGroupInfo tGroupInfo) {
		super.delete(tGroupInfo);
	}
	
}